// ==========================================================================
// GFast自动生成controller操作代码。
// 生成日期：2024-04-24 15:24:03
// 生成路径: internal/app/business/controller/program_types.go
// 生成人：周志雄
// desc:节目类型
// company:云南奇讯科技有限公司
// ==========================================================================


package controller


import (
    "context"
    "github.com/tiger1103/gfast/v3/api/v1/business"
    "github.com/tiger1103/gfast/v3/internal/app/business/service"    
    systemController "github.com/tiger1103/gfast/v3/internal/app/system/controller"    
)


type programTypesController struct {    
    systemController.BaseController    
}


var ProgramTypes = new(programTypesController)


// List 列表
func (c *programTypesController) List(ctx context.Context, req *business.ProgramTypesSearchReq) (res *business.ProgramTypesSearchRes, err error) {
	res, err = service.ProgramTypes().List(ctx, req)
	return
}


// Get 获取节目类型
func (c *programTypesController) Get(ctx context.Context, req *business.ProgramTypesGetReq) (res *business.ProgramTypesGetRes, err error) {
    res = new(business.ProgramTypesGetRes)
	res.ProgramTypesInfoRes,err = service.ProgramTypes().GetById(ctx, req.Id)
	return
}


// Add 添加节目类型
func (c *programTypesController) Add(ctx context.Context, req *business.ProgramTypesAddReq) (res *business.ProgramTypesAddRes, err error) {
	err = service.ProgramTypes().Add(ctx, req)
	return
}


// Edit 修改节目类型
func (c *programTypesController) Edit(ctx context.Context, req *business.ProgramTypesEditReq) (res *business.ProgramTypesEditRes, err error) {
	err = service.ProgramTypes().Edit(ctx, req)
	return
}


// Delete 删除节目类型
func (c *programTypesController) Delete(ctx context.Context, req *business.ProgramTypesDeleteReq) (res *business.ProgramTypesDeleteRes, err error) {
	err = service.ProgramTypes().Delete(ctx, req.Ids)
	return
}